package algorithm;

/**
 * 汉诺塔问题
 */
public class Hanoitower {
  public static void main(String[] args) {
    hanoitower(64,'a','b','c');
  }


  public static void  hanoitower(int num,char a,char b,char c){
      if (num==1){
      System.out.println("从"+a+"-->"+c);
      }else {
          hanoitower(num-1,a,c,b);
          System.out.println("从"+a+"-->"+c);
          hanoitower(num-1,b,a,c);
      }
  }
}
